<template>
  <el-form ref="form" class="form-list">
    <div class="data">
      <div class="form-left">
        <table style="width: 100%;">
          <tr>
            <td class="title" colspan="8">入库单</td>
          </tr>
          <tr>
            <td>部门：{{ form.unitName }}</td>
            <td colspan="2">仓库：{{ form.warehouse }}</td>
            <td>{{ form.year }} 年{{ form.month }} 月{{ form.day }} 日</td>
            <td colspan="2">类别：{{ form.sortName }}</td>
            <td colspan="2">编号：{{ form.number }}</td>
          </tr>
        </table>
        <Table
          ref="table"
          :border="true"
          :current-page="page"
          :header-data="tableHeaderData"
          :index="false"
          :loading="loading"
          :merge-index="7"
          :merge-row="true"
          :show-pagination="false"
          :span-method="true"
          :table-data="form.subTable"
          :total="total"
          class="data-table"
          style="width: 100%"
        />
        <table style="width: 100%;">
          <tr class="tr">
            <td colspan="3">主管：</td>
            <td colspan="3">仓库管理员：</td>
            <!-- <td colspan="2">验收人：</td> -->
            <td colspan="3">经办人：</td>
          </tr>
        </table>
      </div>
      <div class="form-right">
        <div class="vertical-text">{{ name }}</div>
      </div>
    </div>
  </el-form>
</template>

<script>
import addTable from '@/mixins/addtable'

export default {
  name: 'Form',
  mixins: [addTable],
  props: {
    tableHeaderData: {
      type: Array,
      default: () => []
    },
    form: {
      type: Object,
      default: () => {
      }
    },
    name: {
      type: String,
      default: ''
    },
  },
  data () {
    return {}
  },
}
</script>
<style lang="scss" scoped>
.tr {
  display: flex;
  justify-content: space-between;

  td {
    flex: 1;
  }
}
</style>
